#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main()
{
	int n = 0;
	scanf("%d", &n);
	if (n % 400 == 0)
		printf("1\n");
	else if (n % 100 == 0)
		printf("0\n");
	else if (n % 4 == 0)
		printf("1\n");
	else
		printf("0\n");
}